home *** CD-ROM | disk | FTP | other *** search
- Path: news.ahc.ameritech.com!datalytics!usenet
- From: Rob Stewart <stew@datalytics.com>
- Newsgroups: comp.lang.c++,rec.games.programmer,alt.msdos.programmer,comp.programming
- Subject: Re: Young programmers read me.
- Date: Fri, 05 Apr 1996 18:32:36 -0500
- Organization: Datalytics, Inc
- Message-ID: <3165AD94.6F3A@datalytics.com>
- References: <4icpp9$7hr@barad-dur.nas.com> <4imqe4$cj3@ping1.ping.be> <1996Mar23.224853.116513@kuhub.cc.ukans.edu> <4j52hn$ikb@news.ios.com> <Pine.OSF.3.91.960403112207.17337H-100000@bud.cc.swin.edu.au> <aidan-0404961557290001@meathook.intac.com>
- NNTP-Posting-Host: 204.62.224.71
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (WinNT; I)
-
- Aidan Cully wrote:
- >
- > In article <Pine.OSF.3.91.960403112207.17337H-100000@bud.cc.swin.edu.au>,
- > John Joseph Newbigin <079519@bud.cc.swin.edu.au> wrote:
- > > I startted programming in BASIC. Once I realised this was not a "real"
- > > language I started using Pascal. Once I realised Pascal sucks, I started
- > > using C(++). Now I would rather use BASIC than Pascal. That must mean
- > > BASIC is not dieing either?
- > > Newbs
- > C++ is an incredibly ugly language with some of the worst looking
- > constructs I have ever seen(e.g., -> to dereference a pointer to a record?
- > what about a handle? the way this is done is incredibly ugly and more than
- > a little unreadable), and a really very counterintuitive #define block.
- > If C were really a free form language, then the #define directive could
- > not be used as it assumes certain things about syntax (i.e. rest of the
- > line is to be used *only* for the #define block).
-
- #define is a preprocessor macro and is not part of C.
-
- > Add to this that C++
- > does not follow one of the guiding principles of OOP (i.e. hiding the
- > implementation from the user) by allowing people to see the private and
- > protected members of classes,
-
- There is a simple means of doing this:
-
- header:
-
- class X
- {
- private:
- struct XRep;
-
- XRep* m_pRep;
- };
-
- implementation:
-
- struct X::XRep
- {
- // declare data members here
- };
-
- Now, all member functions of X access X's data members through
- m_pRep. Since XRep's declaration is only in the implementation
- file (typically a .C or .cpp file), you can change it at will
- with no effect on X's declaration.
-
- Of course, you get performance losses with such a compilation
- firewall. That is, every data member access is done by
- dereferencing a pointer, and all public and protected member
- functions must not be inline. Once you do these things, you
- lose some of that performance advantage C++ offers.
-
- > and I see one of the ugliest languages
- > developed.
-
- [snip]
-
- > I also think that speed is essential for most commercial applications,
- > and this alone is what makes C/C++ a widely used Commercial application,
- > but I get upset when people confuse "popular" with "good." I'm writing a
- > game in C++ right now because the speed is so good, but just as a
- > programming language, it really blows.
- >
-
- There are idioms and patterns for most things you want to do
- with C++ that alleviate much of what bothers you about the
- language and that reduce errors and performance problems. You
- simply have to do a little reading and research to learn about
- them.
-
- You may not like the symbols used in C++, but I like the code
- compression they provide. Typing '{' is much faster than typing
- 'BEGIN.' Readability is subjective; Greek is not readable until
- you know the language.
-
- --
- Robert Stewart | My opinions are usually my own.
- Datalytics, Inc. | stew@datalytics.com
-